package com.lin.project.cloudnative.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 测试任务
 * @TableName test_task
 */
@TableName(value ="test_task")
@Data
public class TestTask implements Serializable {
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 执行次数
     */
    @TableField(value = "count")
    private Integer count;

    /**
     * 测试用例列表（测试用例id的列表，如【0，1，2，3，4】）
     */
    @TableField(value = "testCaseList")
    private String testCaseList;

    /**
     * 规则集配置（json对象）
     */
    @TableField(value = "ruleSet")
    private String ruleSet;

    /**
     * 状态（0-未开始, 1-执行中, 2-成功, 3-失败）
     */
    @TableField(value = "staticStatus")
    private Integer staticStatus;

    /**
     * 执行耗时(静态划分)
     */
    @TableField(value = "staticTime")
    private Integer staticTime;

    /**
     * 备注信息
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 创建用户 id
     */
    @TableField(value = "userId")
    private Long userId;

    /**
     * 创建时间
     */
    @TableField(value = "createTime")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "updateTime")
    private Date updateTime;

    /**
     * 是否删除
     */
    @TableField(value = "isDelete")
    private Integer isDelete;

    /**
     *
     */
    @TableField(value = "taskName")
    private String taskName;

    /**
     *
     */
    @TableField(value = "dynamicStatus")
    private Integer dynamicStatus;

    /**
     * 执行耗时(动态调整)
     */
    @TableField(value = "dynamicTime")
    private Integer dynamicTime;

    /**
     *
     */
    @TableField(value = "staticLog")
    private String staticLog;

    /**
     *
     */
    @TableField(value = "dynamicLog")
    private String dynamicLog;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TestTask other = (TestTask) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCount() == null ? other.getCount() == null : this.getCount().equals(other.getCount()))
            && (this.getTestCaseList() == null ? other.getTestCaseList() == null : this.getTestCaseList().equals(other.getTestCaseList()))
            && (this.getRuleSet() == null ? other.getRuleSet() == null : this.getRuleSet().equals(other.getRuleSet()))
            && (this.getStaticStatus() == null ? other.getStaticStatus() == null : this.getStaticStatus().equals(other.getStaticStatus()))
            && (this.getStaticTime() == null ? other.getStaticTime() == null : this.getStaticTime().equals(other.getStaticTime()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getTaskName() == null ? other.getTaskName() == null : this.getTaskName().equals(other.getTaskName()))
            && (this.getDynamicStatus() == null ? other.getDynamicStatus() == null : this.getDynamicStatus().equals(other.getDynamicStatus()))
            && (this.getDynamicTime() == null ? other.getDynamicTime() == null : this.getDynamicTime().equals(other.getDynamicTime()))
            && (this.getStaticLog() == null ? other.getStaticLog() == null : this.getStaticLog().equals(other.getStaticLog()))
            && (this.getDynamicLog() == null ? other.getDynamicLog() == null : this.getDynamicLog().equals(other.getDynamicLog()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCount() == null) ? 0 : getCount().hashCode());
        result = prime * result + ((getTestCaseList() == null) ? 0 : getTestCaseList().hashCode());
        result = prime * result + ((getRuleSet() == null) ? 0 : getRuleSet().hashCode());
        result = prime * result + ((getStaticStatus() == null) ? 0 : getStaticStatus().hashCode());
        result = prime * result + ((getStaticTime() == null) ? 0 : getStaticTime().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getTaskName() == null) ? 0 : getTaskName().hashCode());
        result = prime * result + ((getDynamicStatus() == null) ? 0 : getDynamicStatus().hashCode());
        result = prime * result + ((getDynamicTime() == null) ? 0 : getDynamicTime().hashCode());
        result = prime * result + ((getStaticLog() == null) ? 0 : getStaticLog().hashCode());
        result = prime * result + ((getDynamicLog() == null) ? 0 : getDynamicLog().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", count=").append(count);
        sb.append(", testCaseList=").append(testCaseList);
        sb.append(", ruleSet=").append(ruleSet);
        sb.append(", staticStatus=").append(staticStatus);
        sb.append(", staticTime=").append(staticTime);
        sb.append(", remark=").append(remark);
        sb.append(", userId=").append(userId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", taskName=").append(taskName);
        sb.append(", dynamicStatus=").append(dynamicStatus);
        sb.append(", dynamicTime=").append(dynamicTime);
        sb.append(", staticLog=").append(staticLog);
        sb.append(", dynamicLog=").append(dynamicLog);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
